/*
 * LineTracker.h
 *
 *  Created on: 2012.11.17.
 *      Author: Tibi
 */

#include "stm32f4xx.h"
#include "ADC.h"

#ifndef LINETRACKER_H_
#define LINETRACKER_H

typedef struct
{
	float linepos;
	uint8_t valid;
} LineData;


float values[24];
extern __IO uint16_t LT_Values[24];
extern LineData LineArray[3];
// LE: PC5
#define LT_LE_PORT		GPIOC
#define LT_LE_PIN		GPIO_Pin_5
// OE: PA4
#define LT_OEN_PORT		GPIOA
#define LT_OEN_PIN		GPIO_Pin_4

#define LT_MUX_PORT		GPIOB

//AMUX A:	PB0
#define LT_MUXA_PIN		GPIO_Pin_0
//AMUX B:	PB1
#define LT_MUXB_PIN		GPIO_Pin_1
//AMUX C:	PB2
#define LT_MUXC_PIN		GPIO_Pin_2
//AMUX INH:	PC3
#define LT_MUXINH_PORT	GPIOC
#define LT_MUXINH_PIN	GPIO_Pin_3


#define NUM_OF_SENSORS 24



void LT_Init(void);
void LT_Write(uint32_t data);
void LT_RefreshValues(void);
void LT_GetLineData();
void GetLTValues();

#endif /* LINETRACKER_H_ */
